<template>
  <div>
    <div class="My_grid">
      <van-grid :column-num="3" :border="false">
        <van-grid-item icon="star-o" text="我的收藏" @click="Favorite" />
        <van-grid-item icon="wap-home-o" text="我的出租" @click="rent" />
        <van-grid-item icon="underway-o" text="看房记录" />
        <van-grid-item icon="vip-card-o" text="成为房主" />
        <van-grid-item icon="manager-o" text="个人资料" />
        <van-grid-item icon="service-o" text="联系我们" />
      </van-grid>
    </div>
    <div class="My_ad">
      <img src="http://liufusong.top:8080/img/profile/join.png" alt="" />
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data () {
    return {}
  },

  created () {},
  computed: { ...mapState(['user']) },
  methods: {
    Favorite () {
      if (this.user) {
        this.$router.push('/favorite')
      } else {
        this.$router.push('/login')
      }
    },
    rent () {
      if (this.user) {
        this.$router.push('/rent')
      } else {
        this.$router.push('/login')
      }
    }
  }
}
</script>

<style scoped lang="less">
.My_ad {
  text-align: center;
  margin-top: 10px;
  img {
    width: 90%;
  }
}
</style>
